using UnityEngine;

public class ArcherGroundState : EnemyState
{
    protected new Archer Enemy => (Archer)base.Enemy;

    public ArcherGroundState(Enemy enemy, string animName) : base(enemy, animName) { }

    public override void Update()
    {
        base.Update();
        if (Enemy.Player && Vector2.Distance(Enemy.transform.position, Enemy.Player.transform.position) <= Enemy.agroDistance)
            StateMachine.ChangeTo(Enemy.BattleState);
    }
}
